Skip to content

NAV_MESH_AVOID annotation penalizes bot path costs - #2170

Merged
sunzenshen merged 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bot-nav-avoid-path-cost
Oct 9, 2026
Merged

sunzenshen merged 1 commit into
NeotokyoRebuild:masterfrom
sunzenshen:bot-nav-avoid-path-cost

Conversation

@sunzenshen

@sunzenshen sunzenshen commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Bots route around NAV_MESH_AVOID areas

NAV_MESH_AVOID is the stock nav attribute for "avoid this area unless alternatives are too dangerous" (nav.h), set with nav_avoid in the nav editor. Today it means nothing to NT;RE bots: CNEOBotPathCost ignores it, so a mesh author has no way to steer bots away from a problematic spot short of cutting it out of the mesh.

With this PR a step into an AVOID area costs 20 times its cost (neo_bot_path_penalty_avoid_multiplier). Bots route around such an area wherever a reasonable alternative exists. The cost stays finite, so an AVOID area that is the only way somewhere is still used. A ladder crossing pays the multiplier when either end is AVOID, so a risky ladder can be discouraged by marking its foot, not only its top.

One file, neo_bot_path_cost.cpp, +13.

Navmesh PRs that rely on this

These navmesh PRs mark NAV_MESH_AVOID areas and are reviewed and merged after this one. Without it each mesh still loads and works; the marks are ignored.

These also mark NAV_MESH_AVOID areas and were measured only on a build that carries this PR: NeotokyoRebuild/neoAssets#161 (ntre_threadplate_ctg, the crouch-duct pocket), #162 (ntre_sentinel_ctg) and #165 (ntre_sentinel_jgr, the elevator pits and walkway slivers), #164 (ntre_skyline_ctg, ladder 1's foot).

Why a path cost, not removing the area

Cutting an area out of the mesh also removes the only route when nothing else reaches that place, and bots then cannot follow a player or an objective there at all. A cost keeps the route for when it is needed and lets the mesh say "not this way if you have a choice".

Where it applies

No mesh on master carries NAV_MESH_AVOID today. It ships with its first users, the navmesh PRs above. Ridgeline (NeotokyoRebuild/neoAssets#143) marks one area: a 25 u strip between handrails and a power-line tower base where most bot visits stalled. Bots rarely route there at all, so ridgeline shows the mark working rather than a large effect. The measurable effect is on maps whose meshes will mark busier spots. On the research meshes there are 19 AVOID areas on 7 maps:

  • sentinel ctg / jgr: the floor at the foot of the two restored ladder shafts
  • skyline: a ladder foot
  • rise, ridgeline, apparatus, threadplate: pockets, stall spots and ladder ends

Evidence

Bot matches with the research meshes, 30 bots, default weapon damage, CTG with the ghost pinned at 3 spawns (JGR: the juggernaut; DM: unpinned), both arms interleaved in one batch. A temporary cvar switched the multiplier in the test build only; this PR has no switch.

The value. The first batch compared x5, x20 and x100 against off (232 matches, 7 maps):

per match, all 7 maps off x5 x20 x100
bot time on AVOID areas (0.5 s samples) 123 109 78 57
stuck events on AVOID areas 1.88 1.31 1.43 2.03
stuck events, all (paired v off) x0.95 x0.94 x0.86
stuck events, totals v off x0.94 x0.88 x1.12

x100 empties the AVOID areas further but adds long stuck episodes elsewhere, because routes shift onto worse ground. x20 keeps most of the gain without that.

Confirmation, x20 against off (160 matches on the 5 maps whose AVOID areas see traffic, 6 repeats):

  • stuck events on AVOID areas on sentinel_ctg 8.9 -> 0.2 a match (first batch: 5.0 -> 0.8)
  • on skyline 1.1 -> 0.4 (first batch: 1.9 -> 0.3)
  • bot time on AVOID areas 183 -> 124 samples a match
  • stuck events overall x0.92 [0.76, 1.12] paired, 40 down / 38 up
  • kills and fall deaths unchanged

The overall totals of the confirmation batch rise (x1.15) only because of a single match: one sentinel_jgr round in which several bots stuck in the area at the foot of a ladder produced 463 events, 153 of them from one bot. The same spot produces about 105 events over the other matches in either arm.

Risk

Low. Only meshes that mark AVOID are affected, and the cost is finite, so no route is lost.

Toolchain

  • Linux GCC Distro Native (Linux Mint 22.3, GCC 13.3.0)

Linked Issues

sunzenshen added a commit to sunzenshen/neo that referenced this pull request Oct 1, 2026
@sunzenshen
sunzenshen force-pushed the bot-nav-avoid-path-cost branch from fabfab6 to c72254f Compare October 3, 2026 17:50
sunzenshen added a commit to sunzenshen/neoAssets that referenced this pull request Oct 4, 2026
A connectivity check of the open navmesh PRs failed this mesh on two
half cuts. Restore the drops whose climbs were kept: 972 -> 128 off
the crate step near (2262, -375) and 3489 -> 277 off the parapet top
near (-75, -352).

Ghost spawn 7's mezzanine (z -144) was planned only by Recon, up the
crate stack. Restore master's way in for every class, the 69 u drop
3496 -> 3498 off the parapet, one way (the climb back stays cut).

Mark the parapet top (3489, 3496) NAV_MESH_AVOID: it is a 5 u strip
bots fall off, and unmarked it drew Recons off the crate stack, so
they reached the ghost later. Mark ladder 2's foot (885) AVOID: bots
approaching the ladder there catch on a brush, and the restored
routes sent more of them to it. The marks act through a path cost
that honors AVOID (NeotokyoRebuild/neo#2170).

Existing areas keep their ids; both ladders are unchanged.
Re-analyzed in game (same graph, fresh visibility).
@sunzenshen
sunzenshen force-pushed the bot-nav-avoid-path-cost branch from c72254f to 4986c1b Compare October 5, 2026 04:02
@sunzenshen
sunzenshen force-pushed the bot-nav-avoid-path-cost branch from 4986c1b to 48fb15f Compare October 5, 2026 06:00
@sunzenshen
sunzenshen requested a review from sunmachine October 5, 2026 06:01
@sunzenshen
sunzenshen marked this pull request as ready for review October 5, 2026 06:01
@sunzenshen sunzenshen added the Bots Related to bot players label Oct 5, 2026
@sunzenshen sunzenshen changed the title Bots route around NAV_MESH_AVOID areas NAV_MESH_AVOID annotation penalizes bot path costs Oct 5, 2026
@sunmachine

Copy link
Copy Markdown
Contributor

No issues that I can ID. 👍

@sunzenshen
sunzenshen merged commit 34b519d into NeotokyoRebuild:master Oct 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bots Related to bot players

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants